package com.spt.springbootzhsx.service.suggest.Get_Result_7;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.MultipleInputs;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;

/*
 **@Author:邓少勋
 **Created on 2022-06-10
 */
public class Result_Main {
    public static void domain() throws Exception {
        Configuration conf = new Configuration();

        Job job=Job.getInstance(conf,"除去用户已看过的电影");
        job.setJarByClass(Result_Main.class);
        // job.setMapperClass(MU_U_Mapper.class);
        job.setOutputKeyClass(ResultBean.class);
        job.setOutputValueClass(Text.class);
        job.setReducerClass(Result_Reducer.class);
        MultipleInputs.addInputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/input/rate.txt"), TextInputFormat.class, Result_old_Mapper.class);
        MultipleInputs.addInputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step06/part-r-00000"), TextInputFormat.class, Result_all_Mapper.class);


        //FileInputFormat.setInputPaths(job,new Path("C:\\Users\\86147\\Desktop\\rate.txt"));
        //FileOutputFormat.setOutputPath(job,new Path("C:\\Users\\86147\\Desktop\\rateOut\\MUL_5"));
        job.setOutputFormatClass(TextOutputFormat.class);
        TextOutputFormat.setOutputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step07"));
        job.waitForCompletion(true);
    }
}
